<!--
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>LOGIN</title>
    <meta name="description" content="particles.js is a lightweight JavaScript library for creating particles.">
    <meta name="author" content="Vincent Garreau"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" media="screen" th:href="@{/css/login.css}" />
</head>
<body>
&lt;!&ndash; particles.js container &ndash;&gt;
<div id="particles-js" style="display: flex;align-items: center;justify-content: center">
</div>
<div class="login-page">
    <div class="login-content">
        <div class="login-tit">LOGIN</div>
        <form th:action="@{/user/login}" method="post" id="login-form">
            <div class="login-input">
                <label>
                    <input type="text" placeholder="account" name="username">
                </label>
            </div>
            <div class="login-input">
                <label>
                    <input type="password" placeholder="password" name="pwd">
                </label>
            </div>
            <div class="login-btn">
                <div class="login-btn-left">
                    <span onclick="submit()">LOGIN</span>
                </div>
                <div class="login-btn-right" onclick="changeImg()">
                    <img th:src="@{/img/check.png}" alt="" id="picture" /> Remember the password
                </div>
            </div>
        </form>
    </div>
</div>


&lt;!&ndash; scripts &ndash;&gt;
<script th:src="@{/js/particles.js}"></script>
<script th:src="@{/js/app.js}"></script>
<script>
    function changeImg() {
        let pic = document.getElementById('picture');
        console.log(pic.src)
        if (pic.getAttribute("src") === "/img/check.png") {
            pic.src = "./img/checked.png"
        } else {
            pic.src = "/img/check.png"
        }
    }

    function submit() {
        let form = document.getElementById("login-form");
        form.submit();
    }
</script>
</body>
</html>-->
<!--<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LOGIN</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" crossorigin="anonymous">
    <style>
        body, html {
            height: 100%;
            margin: 0;
            font-family: 'Arial', sans-serif;
            background-color: #f8f9fa;
        }
        .login-container {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
        .login-box {
            background-color: #ffffff;
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        .login-title {
            font-size: 2em;
            color: #007bff;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .login-input {
            margin-bottom: 20px;
        }
        .login-input input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 1em;
        }
        .login-btn {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .login-btn-left span {
            background-color: #007bff;
            color: #fff;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .login-btn-left span:hover {
            background-color: #0056b3;
        }
        .login-btn-right {
            display: flex;
            align-items: center;
            cursor: pointer;
            color: #007bff;
        }
        .login-btn-right img {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-box">
        <div class="login-title">LOGIN</div>
        <form th:action="@{/user/login}" method="post" id="login-form">
            <div class="login-input">
                <input type="text" placeholder="Account" name="username" required>
            </div>
            <div class="login-input">
                <input type="password" placeholder="Password" name="pwd" required>
            </div>
            <div class="login-btn">
                <div class="login-btn-left">
                    <span onclick="submitForm()">LOGIN</span>
                </div>
                <div class="login-btn-right" onclick="toggleRememberMe()">
                    <img th:src="@{/img/check.png}" alt="" id="remember-me-icon" /> Remember Me
                </div>
            </div>
        </form>
    </div>
</div>

&lt;!&ndash; scripts &ndash;&gt;
<script th:src="@{/js/particles.js}"></script>
<script th:src="@{/js/app.js}"></script>
<script>
    function toggleRememberMe() {
        let icon = document.getElementById('remember-me-icon');
        icon.src = icon.src.includes('check.png') ? './img/checked.png' : './img/check.png';
    }

    function submitForm() {
        document.getElementById('login-form').submit();
    }
</script>
</body>
</html>-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>LOGIN</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" crossorigin="anonymous">
    <style>
        body, html {
            height: 100%;
            margin: 0;
            font-family: 'Arial', sans-serif;
            background: url('/img/background.jpg') no-repeat center center fixed;
            background-size: cover;
        }
        .login-container {
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
        }
        .login-box {
            background-color: rgba(255, 255, 255, 0.9);
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        .login-title {
            font-size: 2em;
            color: #007bff;
            font-weight: bold;
            margin-bottom: 20px;
        }
        .login-input {
            margin-bottom: 20px;
        }
        .login-input input {
            width: 100%;
            padding: 10px;
            border: 1px solid #ced4da;
            border-radius: 5px;
            font-size: 1em;
        }
        .login-btn {
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .login-btn-left span {
            background-color: #007bff;
            color: #fff;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        .login-btn-left span:hover {
            background-color: #0056b3;
        }
        .login-btn-right {
            display: flex;
            align-items: center;
            cursor: pointer;
            color: #007bff;
        }
        .login-btn-right img {
            width: 20px;
            height: 20px;
            margin-right: 10px;
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-box">
        <div class="login-title">LOGIN</div>
        <form th:action="@{/user/login}" method="post" id="login-form">
            <div class="login-input">
                <input type="text" placeholder="Account" name="username" required>
            </div>
            <div class="login-input">
                <input type="password" placeholder="Password" name="pwd" required>
            </div>
            <div class="login-btn">
                <div class="login-btn-left">
                    <span onclick="submitForm()">LOGIN</span>
                </div>
                <div class="login-btn-right" onclick="toggleRememberMe()">
                    <img th:src="@{/img/check.png}" alt="" id="remember-me-icon" /> Remember Me
                </div>
            </div>
        </form>
    </div>
</div>

<!-- scripts -->
<script th:src="@{/js/particles.js}"></script>
<script th:src="@{/js/app.js}"></script>
<script>
    function toggleRememberMe() {
        let icon = document.getElementById('remember-me-icon');
        icon.src = icon.src.includes('check.png') ? './img/checked.png' : './img/check.png';
    }

    function submitForm() {
        document.getElementById('login-form').submit();
    }
</script>
</body>
</html>

